home *** CD-ROM | disk | FTP | other *** search
/ CICA 1993 April / CICA MS Windows - April 1993.iso / unzipped / programr / tp / drovtb / tbobj.pas next >
Pascal/Delphi Source File  |  1992-03-09  |  33KB  |  927 lines

  1. unit TBOBJ;
  2.  
  3. interface
  4. uses  WObjects, WinProcs, WinTypes, Strings, Toolbox;
  5.  
  6. {---------------------------------------------------------------------------------------------}
  7. { SPREADSHEET CONTROL                                                                         }
  8. {---------------------------------------------------------------------------------------------}
  9.  
  10. type
  11.   PSpreadsheet = ^TSpreadsheet;
  12.   TSpreadsheet = object(TControl)
  13.     constructor Init(aParent: PWindowsObject; AnID: Integer; aTitle: PChar; X,Y,W,H: Integer);
  14.     function    GetClassName: PChar; virtual;
  15.     function    BuildDependencies: Boolean; virtual;
  16.     function    ClearCell(Col, Row: TSS_Coord)                           : Boolean;
  17.     function    ClearRange(Col, Row, Col2, Row2: TSS_Coord)        : Boolean;
  18.     function    ClipIn(Col, Row, Col2, Row2: TSS_Coord;
  19.                    lpBuffer: PChar; BufLen: Longint)               : Boolean;
  20.     function    ClipOut(Col, Row, Col2, Row2: TSS_Coord)           : THandle;
  21.     function    ColWidthToLogUnits(ColWidth: Double)               : Integer;
  22.     function    DelCol(Col: TSS_Coord)                             : Boolean;
  23.     function    DelRow(Row: TSS_Coord)                             : Boolean;
  24.     function    DeSelectBlock                                      : Boolean;
  25.     function    GetActiveCell(var Col, Row: TSS_Coord)             : Boolean;
  26.     function    GetBool(nIndex: Integer)                           : Boolean;
  27.     function    GetBottomRightCell                                 : Longint;
  28.     function    GetCellType(Col, Row: TSS_Coord;
  29.                    var CellType: TSS_CellType)                     : Boolean;
  30.     function    GetColor(Col, Row: TSS_Coord;
  31.                    var Background, Foreground: TColorRef)       : Boolean;
  32.     function    GetColWidth(Col: TSS_Coord)                        : Double ;
  33. {   function    GetCurrSelBlockPos(var CurrCol, CurrRow: TSS_Coord): Boolean; }
  34.     function    GetData(Col, Row: TSS_Coord; Data: PChar)          : Integer;
  35.     function    GetDataLen(Col, Row: TSS_Coord)                    : Integer;
  36.     function    GetEditMode                                        : Boolean;
  37.     function    GetFont(Col, Row: TSS_Coord)                       : THandle;
  38.     function    GetFormula(Col, Row: TSS_Coord; Formula: PChar)    : Integer;
  39.     function    GetFormulaLen(Col, Row: TSS_Coord)                 : Integer;
  40. {   function    GetLock(Col, Row: TSS_Coord)                       : Boolean; }
  41.     function    GetMaxCols                                         : TSS_Coord;
  42.     function    GetMaxRows                       : TSS_Coord;
  43.     function    GetRowHeight(Row: TSS_Coord)               : Double;
  44.     function    GetSel(var SelStart, SelEnd: Integer)              : Boolean;
  45.     function    GetSelectBlock(var UL, LR: TSS_CellCoord)          : Boolean;
  46.     function    GetSelText                                         : THandle;
  47.     procedure   GetShadowColor(var ShColor, ShText,
  48.                                    ShDark, ShLight: TColorRef)     ; virtual;
  49.     function    GetTopLeftCell                                     : Longint;
  50.     function    GetVisible(Col, Row: TSS_Coord; Visible: Integer)  : Boolean;
  51.     function    HighlightRow                                       : Boolean; { Eigene Funktion }
  52.     function    InsCol(Col: TSS_Coord)                             : Boolean;
  53.     function    InsRow(Row: TSS_Coord)                             : Boolean;
  54.     function    LoadFromBuffer(hBuffer: THandle; BufLen: Longint)  : Boolean;
  55.     function    LoadFromFile(FileName: PChar)                      : Boolean;
  56.     function    LogUnitsToColWidth(Units: Integer)                 : Double ;
  57.     function    ReCalc                                             : Boolean;
  58.     function    ReplaceSel(lpText: PChar)                          : Boolean;
  59.     function    RowHeightToLogUnits(Row: TSS_Coord;
  60.                    RowHeight: Double)                   : Integer;
  61.     function    SaveToBuffer(var BufferLen: Longint;
  62.                    DataOnly: Boolean)                              : THandle;
  63.     function    SaveToFile(var FileName: PChar; DataOnly: Boolean) : Boolean;
  64.     function    SetActiveCell(Col, Row: TSS_Coord)                 : Boolean;
  65.     function    SetBool(Index: Integer; NewVal: Boolean)           : Boolean;
  66.     function    SetCellType(Col, Row: TSS_Coord;
  67.                    var CellType: TSS_CellType)                    : Boolean;
  68.     function    SetCellTypeRange(Col, Row, Col2, Row2: TSS_Coord;
  69.                    var CellType: TSS_CellType)             : Boolean;
  70.     function    SetColor(Col, Row: TSS_Coord;
  71.                    Foreground, Background: TColorRef)               : Boolean;
  72.     function    SetColorRange(Col, Row, Col2, Row2: TSS_Coord;
  73.                    Background, Foreground: TColorRef)              : Boolean;
  74.     function    SetColWidth(Col: TSS_Coord; Height: Integer)       : Boolean;
  75.     function    SetData(Col, Row: TSS_Coord; Data: PChar)          : Boolean;
  76.     function    SetDataRange(Col, Row, Col2, Row2: TSS_Coord;
  77.                    Data: PChar)                       : Boolean;
  78.     function    SetEditMode(EditModeOn: Boolean)                   : Boolean;
  79.     function    SetFont(Col, Row: TSS_Coord; Font: THandle;
  80.                    DeleteFont: Boolean)                : Boolean;
  81.     function    SetFontRange(Col, Row, Col2, Row2: TSS_Coord;
  82.                    Font: THandle; DeleteFont: Boolean)          : Boolean;
  83.     function    SetFormula(Col, Row: TSS_Coord; Formula: PChar;
  84.                    BuildDep: Boolean)                              : Boolean;
  85.     function    SetFormulaRange(Col, Row, Col2, Row2: TSS_Coord;
  86.                    Formula: PChar; BuildDep: Boolean)              : Boolean;
  87.     function    SetLock(Col, Row: TSS_Coord; Lock: Boolean)        : Boolean;
  88.     function    SetLockRange(Col, Row, Col2, Row2: TSS_Coord;
  89.                    Lock: Boolean)                               : Boolean;
  90.     procedure   SetMaxCols(MaxCols: Integer);
  91.     procedure   SetMaxRows(MAxRows: Integer);
  92.     function    SetRowHeight(Row: TSS_Coord; Height: Double)       : Boolean;
  93.     function    SetSel(SelStart, SelEnd: Integer)           : Boolean;
  94.     function    SetSelectBlock(var CellUL, CellLR: TSS_CellCoord)  : Boolean;
  95.     procedure   SetShadowColor(ShColor, ShTxt, ShDark,
  96.                    ShLight: TColorRef);
  97.     function    SetTypeDate(var CellType: TSS_CellType;
  98.                    Style: Longint;
  99.                    var Format: TDateFormat;
  100.                    var Min, Max: TDate)                         : PSS_CellType;
  101.  
  102.     function    SetTypeEdit(var CellType: TSS_CellType;
  103.                    Style: Longint;
  104.                    Len, ChrSet: Integer;
  105.                    ChrCase: Byte)                   : PSS_CellType;
  106.     function    SetTypeFloat(var CellType: TSS_CellType;
  107.                    Style: Longint;
  108.                    Left, Right: Integer;
  109.                    Min, Max: Double)                            : PSS_CellType;
  110.     function    SetTypeInteger(var CellType: TSS_CellType;
  111.                    Min, Max: Longint)                            : PSS_CellType;
  112.     function    SetTypePic(var CellType: TSS_CellType;
  113.                    Style: Longint; Mask: PChar)                    : PSS_CellType;
  114.     function    SetTypePicture(var CellType: TSS_CellType;
  115.                    Style: Longint; PictName: PChar)                : PSS_CellType;
  116.     function    SetTypeStaticText(var CellType: TSS_CellType;
  117.                    Style: Integer)                   : PSS_CellType;
  118.     function    SetTypeTime(var CellType: TSS_CellType;
  119.                    Style: Longint;
  120.                    var Format: TTimeFormat;
  121.                    var Min, Max: TTime)                         : PSS_CellType;
  122.     function    ShowActiveCell(Position: Integer)           : Boolean;
  123.     function    ShowCell(Col, Row: TSS_Coord; Position: Integer)   : Boolean;
  124.     function    ValidateFormula(Formula: PChar)                    : Boolean;
  125.   end;
  126.  
  127.  
  128. {----------------------------------------------------------------------------------------------------------}
  129. { FLOAT CONTROL CLASS                                                                                      }
  130. {----------------------------------------------------------------------------------------------------------}
  131.  
  132.   PFloatEdit = ^TFloatEdit;
  133.   TFloatEdit = object(TStatic)
  134.     constructor Init(aParent: PWindowsObject; AnID: Integer; ATitle: PChar; X,Y,W,H: Integer);
  135.     function    GetClassName                                       : PChar  ; virtual;
  136.     function    GetFormat(var Fmt: TFloatFormat)                   : Boolean;
  137.     function    GetRange(var Min, Max: Double)                     : Boolean;
  138.     function    GetValue(var LongValue: Double)                    : Boolean;
  139.     function    SetFormat(var Fmt: TFloatFormat)                   : Boolean;
  140.     function    SetMask(Mask: PChar)                               : Boolean;
  141.     function    SetRange(Min, Max: Longint)                        : Boolean;
  142.     function    SetStyle(Style: Longint)                           : Boolean;
  143.     function    SetValue(LongValue: Longint)                       : Boolean;
  144.   end;
  145.  
  146.  
  147. {----------------------------------------------------------------------------------------------------------}
  148. { INTEGER CONTROL CLASS                                                                                    }
  149. {----------------------------------------------------------------------------------------------------------}
  150. { Control Styles
  151.   IS_SPIN        Add a spin Button to the right side
  152.   IS_SPINWRAP    Wrap from the maximum to the minimum and visa versa }
  153.  
  154.   PIntEdit = ^TIntEdit;
  155.   TIntEdit = object(TEdit)
  156.     constructor Init(aParent: PWindowsObject; AnID: Integer; ATitle: PChar; X,Y,W,H: Integer);
  157.     function    GetClassName                                       : PChar  ; virtual;
  158.     function    GetValue(var LongValue: Longint)                   : Boolean;
  159.     function    SetMask(Mask: PChar)                               : Boolean;
  160.     function    SetRange(Min, Max: Longint)                        : Boolean;
  161.     function    SetSpin(Spin, SpinWrap: Boolean; SpinInc: Longint) : Boolean;
  162.     function    SetValue(LongValue: Longint)                       : Boolean;
  163.   end;
  164.  
  165.  
  166. {----------------------------------------------------------------------------------------------------------}
  167. { PIC CONTROL CLASS                                                                                        }
  168. {----------------------------------------------------------------------------------------------------------}
  169.  
  170.   PPicEdit = ^TPicEdit;
  171.   TPicEdit = object(TEdit)
  172.     constructor Init(aParent: PWindowsObject; AnID: Integer; ATitle: PChar; X,Y,W,H: Integer);
  173.     function    GetClassName                                    : PChar; virtual;
  174.     function    GetMask(Mask: PChar)                            : Boolean;
  175.     function    SetCallBack                                     : Boolean;
  176.     function    SetMask(Mask: PChar)                            : Boolean;
  177.   end;
  178.  
  179.  
  180. {----------------------------------------------------------------------------------------------------------}
  181. { IMPRINT CONTROL CLASS                                                                                    }
  182. {----------------------------------------------------------------------------------------------------------}
  183.  
  184.   PImprint = ^TImprint;
  185.   TImprint = object(TStatic)
  186.     constructor Init(aParent: PWindowsObject; AnID: Integer; ATitle: PChar; X,Y,W,H: Integer);
  187.     function    GetClassName                                  : PChar; virtual;
  188.     procedure   GetColor(var ImprintColor: TImprintColor);
  189.     function    GetFrameSize                                  : Word   ; virtual;
  190.     function    GetLineCnt                                    : Longint; virtual; { Low, High Word }
  191.     function    GetLineSize                                   : Word;
  192.     function    GetShadowSize                                 : Word;
  193.     procedure   SetColor(var ImprintColor: TImprintColor);
  194.     procedure   SetFrameSize(Size: Word);
  195.     procedure   SetLineCnt(Horiz, Vert: Word);
  196.     procedure   SetLineSize(Size: Word);
  197.     procedure   SetShadowSize(Size: Word);
  198.   end;
  199.  
  200.  
  201. {----------------------------------------------------------------------------------------------------------}
  202. { SUPERBUTTON CONTROL CLASS                                                                                }
  203. {----------------------------------------------------------------------------------------------------------}
  204.  
  205.   PSuperButton = ^TSuperButton;
  206.   TSuperButton = object(TButton)
  207.     constructor Init(aParent: PWindowsObject; AnID: Integer; ATitle: PChar; X,Y,W,H: Integer);
  208.     function    GetClassName                                    : PChar  ; virtual;
  209.     procedure   GetColor       (var Color: TSuperBtnColor);
  210.     procedure   SetColor       (var Color: TSuperBtnColor);
  211.     function    SetPict        (PicType: Word; Resource: PChar) : Boolean;
  212.     function    SetPictBtnDown (PicType: Word; Resource: PChar) : Boolean;
  213.     function    SetPictDisabled(PicType: Word; Resource: PChar)    : Boolean;
  214.     procedure   SetStyle(Style: Word);
  215.   end;
  216.  
  217.  
  218. {----------------------------------------------------------------------------------------------------------}
  219. { DATE CONTROL CLASS                                                                                       }
  220. {----------------------------------------------------------------------------------------------------------}
  221.  
  222.   PDateEdit = ^TDateEdit;
  223.   TDateEdit = object(TEdit)
  224.     constructor Init(aParent: PWindowsObject; AnID: Integer; ATitle: PChar; X,Y,W,H: Integer);
  225.     function    GetClassName                                       : PChar; virtual;
  226.     function    GetFormat(var DateFmt: TDateFormat)                : Boolean;
  227.     function    SetFormat(var DateFmt: TDateFormat)                : Boolean;
  228.     function    SetRange(var MinDate, MaxDate: TDate)              : Boolean;
  229.   end;
  230.  
  231.  
  232. {----------------------------------------------------------------------------------------------------------}
  233. implementation
  234. {----------------------------------------------------------------------------------------------------------}
  235.  
  236.  
  237. {----------------------------------------------------------------------------------------------------------}
  238. { SPREADSHEET CONTROL IMPLEMENTATION                                                                       }
  239. {----------------------------------------------------------------------------------------------------------}
  240.  
  241. constructor TSpreadsheet.Init(aParent: PWindowsObject; AnID: Integer; aTitle: PChar; X,Y,W,H: Integer);
  242. begin
  243.   TControl.Init(aParent, anID, aTitle, X,Y,W,H);
  244.   Attr.Style := (Attr.Style and not ss_Left) or ws_Border or ws_TabStop;
  245. end;
  246.  
  247. function TSpreadsheet.GetClassName: PChar;
  248. begin
  249.   GetClassName := 'tbSpreadsheet';
  250. end;
  251.  
  252. function TSpreadsheet.BuildDependencies;
  253. begin
  254.   BuildDependencies := SSBuildDependencies(HWindow)
  255. end;
  256.  
  257.  
  258. function TSpreadsheet.ClearCell;
  259. begin
  260.   ClearCell := SSClear(HWindow, Col, Row)
  261. end;
  262.  
  263. function TSpreadsheet.ClearRange;
  264. begin
  265.   ClearRange := SSClearRange(HWindow, Col, Row, Col2, Row2)
  266. end;
  267.  
  268.  
  269. function TSpreadsheet.ClipIn;
  270. begin
  271.   ClipIn := SSClipIn(HWindow, Col, Row, Col2, Row2, lpBuffer, BufLen)
  272. end;
  273.  
  274. function TSpreadsheet.ClipOut;
  275. begin
  276.   ClipOut := SSClipOut(HWindow, Col, Row, Col2, Row2)
  277. end;
  278.  
  279. function TSpreadsheet.ColWidthToLogUnits;
  280. begin
  281.  ColWidthToLogUnits := SSColWidthToLogUnits(HWindow, ColWidth)
  282. end;
  283.  
  284. procedure TSpreadsheet.SetMaxRows;
  285. begin
  286.   SSSetMaxRows(HWindow, MaxRows);
  287. end;
  288.  
  289. procedure TSpreadsheet.SetMaxCols;
  290. begin
  291.   SSSetMaxCols(HWindow, MaxCols);
  292. end;
  293.  
  294. function TSpreadsheet.DelCol;
  295. begin
  296.   DelCol := SSDelCol(HWindow, Col)
  297. end;
  298.  
  299. function TSpreadsheet.DelRow;
  300. begin
  301.   DelRow := SSDelRow(HWindow, Row)
  302. end;
  303.  
  304. function TSpreadsheet.DeSelectBlock;
  305. begin
  306.   DeSelectBlock := SSDeselectBlock(HWindow)
  307. end;
  308.  
  309. function TSpreadsheet.GetActiveCell;
  310. begin
  311.   GetActiveCell := SSGetActiveCell(HWindow, Col, Row)
  312. end;
  313.  
  314. function TSpreadsheet.GetBool;
  315. begin
  316.   GetBool := SSGetBool(HWindow, nIndex)
  317. end;
  318.  
  319. function TSpreadsheet.GetBottomRightCell;
  320. begin
  321.   GetBottomRightCell := SSGetBottomRightCell(HWindow)
  322. end;
  323.  
  324. function TSpreadsheet.GetCellType;
  325. begin
  326.   GetCellType := SSGetCellType(HWindow, Col, Row, CellType)
  327. end;
  328.  
  329. function TSpreadsheet.GetColor;
  330. begin
  331.   GetColor := SSGetColor(HWindow, Col, Row, Background, Foreground)
  332. end;
  333.  
  334. function TSpreadsheet.GetColWidth;
  335. begin
  336.   GetColWidth := SSGetColWidth(HWindow, Col)
  337. end;
  338.  
  339. {
  340. function TSpreadsheet.GetCurrSelBlockPos;
  341. begin
  342.   GetCurrSelBlockPos := SSGetCurrSelBlockPos(HWindow, CurrCol, CurrRow)
  343. end;
  344. }
  345.  
  346. function TSpreadsheet.GetData;
  347. begin
  348.   GetData := SSGetData(HWindow, Col, Row, Data)
  349. end;
  350.  
  351. function TSpreadsheet.GetDataLen;
  352. begin
  353.   GetDataLen := SSGetDataLen(HWindow, Col, Row)
  354. end;
  355.  
  356. function TSpreadsheet.GetEditMode;
  357. begin
  358.   GetEditMode := SSGetEditMode(HWindow)
  359. end;
  360.  
  361. function TSpreadsheet.GetFont;
  362. begin
  363.   GetFont := SSGetFont(HWindow, Col, Row)
  364. end;
  365.  
  366. function TSpreadsheet.GetFormula;
  367. begin
  368.   GetFormula := SSGetFormula(HWindow, Col, Row, Formula)
  369. end;
  370.  
  371. function TSpreadsheet.GetFormulaLen;
  372. begin
  373.   GetFormulaLen := SSGetFormulaLen(HWindow, Col, Row)
  374. end;
  375.  
  376. {
  377. function TSpreadsheet.GetLock;
  378. begin
  379.   GetLock := SSGetLock(HWindow, Col, Row)
  380. end;
  381. }
  382.  
  383. function TSpreadsheet.GetMaxCols;
  384. begin
  385.   GetMaxCols := SSGetMaxCols(HWindow)
  386. end;
  387.  
  388. function TSpreadsheet.GetMaxRows;
  389. begin
  390.   GetMaxRows := SSGetMaxRows(HWindow)
  391. end;
  392.  
  393. function TSpreadsheet.GetRowHeight;
  394. begin
  395.   GetRowHeight := SSGetRowHeight(HWindow, Row)
  396. end;
  397.  
  398. function TSpreadsheet.GetSel;
  399. begin
  400.   GetSel := SSGetSel(HWindow, SelStart, SelEnd)
  401. end;
  402.  
  403. function TSpreadsheet.GetSelectBlock;
  404. begin
  405.   GetSelectBlock := SSGetSelectBlock(HWindow, UL, LR)
  406. end;
  407.  
  408. function TSpreadsheet.GetSelText;
  409. begin
  410.   GetSelText := SSGetSelText(HWindow)
  411. end;
  412.  
  413. procedure TSpreadsheet.GetShadowColor;
  414. begin
  415.   SSGetShadowColor(HWindow, ShColor, ShText, ShDark, ShLight)
  416. end;
  417.  
  418. function TSpreadsheet.GetTopLeftCell;
  419. begin
  420.   GetTopLeftCell := SSGetTopLeftCell(HWindow)
  421. end;
  422.  
  423. function TSpreadsheet.GetVisible;
  424. begin
  425.   GetVisible := SSGetVisible(HWindow, Col, Row, Visible)
  426. end;
  427.  
  428. { Eigene Funktion }
  429. function TSpreadsheet.HighlightRow;
  430. var
  431.   Row, Col: TSS_Coord;
  432.   UL, LR  : TSS_CellCoord;
  433. begin
  434.   GetActiveCell(Col, Row);
  435.   UL.Row := Row; UL.Col := 1;
  436.   LR.Row := Row; LR.Col := GetMaxCols;
  437.   HighlightRow := SetSelectBlock(UL, LR);
  438. end;
  439.  
  440. function TSpreadsheet.InsCol;
  441. begin
  442.   InsCol := SSInsCol(HWindow, Col)
  443. end;
  444.  
  445. function TSpreadsheet.InsRow;
  446. begin
  447.   InsRow := SSInsRow(HWindow, Row)
  448. end;
  449.  
  450. function TSpreadsheet.LoadFromBuffer;
  451. begin
  452.   LoadFromBuffer := SSLoadFromBuffer(HWindow, hBuffer, BufLen)
  453. end;
  454.  
  455. function TSpreadsheet.LoadFromFile;
  456. begin
  457.   LoadFromFile := SSLoadFromFile(HWindow, FileName)
  458. end;
  459.  
  460. function TSpreadsheet.LogUnitsToColWidth;
  461. begin
  462.   LogUnitsToColWidth := SSLogUnitsToColWidth(HWindow, Units)
  463. end;
  464.  
  465. function TSpreadsheet.ReCalc;
  466. begin
  467.   ReCalc := SSReCalc(HWindow)
  468. end;
  469.  
  470. function TSpreadsheet.ReplaceSel;
  471. begin
  472.   ReplaceSel := SSReplaceSel(HWindow, lpText)
  473. end;
  474.  
  475. function TSpreadsheet.RowHeightToLogUnits;
  476. begin
  477.   RowHeightToLogUnits := SSRowHeightToLogUnits(HWindow, Row, RowHeight)
  478. end;
  479.  
  480. function TSpreadsheet.SaveToBuffer;
  481. begin
  482.   SaveToBuffer := SSSaveToBuffer(HWindow, BufferLen, DataOnly)
  483. end;
  484.  
  485. function TSpreadsheet.SaveToFile;
  486. begin
  487.   SaveToFile := SSSaveToFile(HWindow, FileName, DataOnly)
  488. end;
  489.  
  490. function TSpreadsheet.SetActiveCell;
  491. begin
  492.   SetActiveCell := SSSetActiveCell(HWindow, Col, Row)
  493. end;
  494.  
  495. function TSpreadsheet.SetBool;
  496. begin
  497.   SetBool := SSSetBool(HWindow, Index, NewVal)
  498. end;
  499.  
  500. function TSpreadsheet.SetCellType;
  501. begin
  502.   SetCellType := SSSetCellType(HWindow, Col, Row, CellType)
  503. end;
  504.  
  505. function TSpreadsheet.SetCellTypeRange;
  506. begin
  507.   SetCellTypeRange := SSSetCellTypeRange(HWindow, Col, Row, Col2, Row2, CellType)
  508. end;
  509.  
  510. function TSpreadsheet.SetColor;
  511. begin
  512.   SetColor := SSSetColor(HWindow, Col, Row, Background, Foreground)
  513. end;
  514.  
  515. function TSpreadsheet.SetColorRange;
  516. begin
  517.   SetColorRange := SSSetColorRange(HWindow, Col, Row, Col2, Row2, Background, Foreground)
  518. end;
  519.  
  520. function TSpreadsheet.SetColWidth;
  521. begin
  522.   SetColWidth := SSSetColWidth(HWindow, Col, Height)
  523. end;
  524.  
  525. function TSpreadsheet.SetData;
  526. begin
  527.   SetData := SSSetData(HWindow, Col, Row, Data)
  528. end;
  529.  
  530. function TSpreadsheet.SetDataRange;
  531. begin
  532.   SetDataRange := SSSetDataRange(HWindow, Col, Row, Col2, Row2, Data)
  533. end;
  534.  
  535. function TSpreadsheet.SetEditMode;
  536. begin
  537.   SetEditMode := SSSetEditMode(HWindow, EditModeOn)
  538. end;
  539.  
  540. function TSpreadsheet.SetFont;
  541. begin
  542.   SetFont := SSSetFont(HWindow, Col, Row, Font, DeleteFont)
  543. end;
  544.  
  545. function TSpreadsheet.SetFontRange;
  546. begin
  547.   SetFontRange := SSSetFontRange(HWindow, Col, Row, Col2, Row2, Font, DeleteFont)
  548. end;
  549.  
  550. function TSpreadsheet.SetFormula;
  551. begin
  552.   SetFormula := SSSetFormula(HWindow, Col, Row, Formula, BuildDep)
  553. end;
  554.  
  555. function TSpreadsheet.SetFormulaRange;
  556. begin
  557.   SetFormulaRange := SSSetFormulaRange(HWindow, Col, Row, Col2, Row2, Formula, BuildDep)
  558. end;
  559.  
  560. function TSpreadsheet.SetLock;
  561. begin
  562.   SetLock := SSSetLock(HWIndow, Col, Row, Lock)
  563. end;
  564.  
  565. function TSpreadsheet.SetRowHeight(Row: TSS_Coord; Height: Double): Boolean;
  566. begin
  567.   SetRowHeight := SSSetRowHeight(HWindow, Row, Height)
  568. end;
  569.  
  570. function TSpreadsheet.SetSel;
  571. begin
  572.   SetSel := SSSetSel(HWIndow, SelStart, SelEnd)
  573. end;
  574.  
  575. function TSpreadSheet.SetSelectBlock(var CellUL, CellLR: TSS_CellCoord): Boolean;
  576. begin
  577.   SetSelectBlock := SSSetSelectBlock(HWindow, CellUL, CellLR)
  578. end;
  579.  
  580. function TSpreadsheet.SetLockRange;
  581. begin
  582.   SetLockRange := SSSetLockRange(HWindow, Col, Row, Col2, Row2, Lock)
  583. end;
  584.  
  585. procedure TSpreadsheet.SetShadowColor(ShColor, ShTxt, ShDark, ShLight: TColorRef);
  586. begin
  587.   SSSetShadowColor(HWindow, ShColor, ShTxt, ShDark, ShLight)
  588. end;
  589.  
  590. function TSpreadsheet.SetTypeDate; { (var CellType: TSS_CellType; Style: Longint; var Format: TDateFormat;
  591.                       var Min, Max: TDate) : PSS_CellType; }
  592. begin
  593.   SetTypeDate := SSSetTypeDate(HWindow, CellType, Style, Format, Min, Max)
  594. end;
  595.  
  596.  
  597. function TSpreadsheet.SetTypeEdit(var CellType: TSS_CellType; Style: Longint; Len, ChrSet: Integer;
  598.                       ChrCase: Byte) : PSS_CellType;
  599. begin
  600.   SetTypeEdit := SSSetTypeEdit(HWindow, CellType, Style, Len, ChrSet, ChrCase)
  601. end;
  602.  
  603.  
  604. function TSpreadsheet.SetTypeFloat(var CellType: TSS_CellType; Style: Longint; Left, Right: Integer;
  605.                       Min, Max: Double) : PSS_CellType;
  606. begin
  607.   SetTypeFloat := SSSetTypeFloat(HWindow, CellType, Style, Left, Right, Min, Max)
  608. end;
  609.  
  610. function TSpreadsheet.SetTypeInteger(var CellType: TSS_CellType; Min, Max: Longint) : PSS_CellType;
  611. begin
  612.   SetTypeInteger := SSSetTypeInteger(HWindow, CellType, Min, Max)
  613. end;
  614.  
  615. function TSpreadsheet.SetTypePic(var CellType: TSS_CellType; Style: Longint; Mask: PChar) : PSS_CellType;
  616. begin
  617.   SetTypePic := SSSetTypePic(HWindow, CellType, Style, Mask)
  618. end;
  619.  
  620. function TSpreadsheet.SetTypePicture(var CellType: TSS_CellType; Style: Longint; PictName: PChar) : PSS_CellType;
  621. begin
  622.   SetTypePicture := SSSetTypePicture(HWindow, CellType, Style, PictName)
  623. end;
  624.  
  625. function TSpreadsheet.SetTypeStaticText(var CellType: TSS_CellType; Style: Integer) : PSS_CellType;
  626. begin
  627.   SetTypeStaticText := SSSetTypeStaticText(HWindow, CellType, Style)
  628. end;
  629.  
  630. function TSpreadsheet.SetTypeTime(var CellType: TSS_CellType; Style: Longint; var Format: TTimeFormat;
  631.                       var Min, Max: TTime) : PSS_CellType;
  632. begin
  633.   SetTypeTime := SSSetTypeTime(HWindow, CellType, Style, Format, Min, Max)
  634. end;
  635.  
  636. function TSpreadsheet.ShowActiveCell(Position: Integer)    : Boolean;
  637. begin
  638.   ShowActiveCell := SSShowActiveCell(HWindow, Position)
  639. end;
  640.  
  641. function TSpreadsheet.ShowCell(Col, Row: TSS_Coord; Position: Integer) : Boolean;
  642. begin
  643.   ShowCell := SSShowCell(HWindow, Col, Row, Position)
  644. end;
  645.  
  646. function TSpreadsheet.ValidateFormula(Formula: PChar) : Boolean;
  647. begin
  648.   ValidateFormula := SSValidateFormula(HWindow, Formula)
  649. end;
  650.  
  651. {---------------------------------------------------------------------------------------------------- }
  652. { FLOAT CONTROL IMPLEMENTATION                                                  }
  653. {---------------------------------------------------------------------------------------------------- }
  654.  
  655. constructor TFloatEdit.Init(aParent: PWindowsObject; AnID: Integer; ATitle: PChar; X,Y,W,H: Integer);
  656. begin
  657.   TStatic.Init(aParent, anID, aTitle, X,Y,W,H, 12);
  658.   Attr.Style := (Attr.Style and not ss_Left) or ws_Border or ws_TabStop;
  659. end;
  660.  
  661. function TFloatEdit.GetClassName : PChar;
  662. begin
  663.   GetClassName := 'tbFloat'
  664. end;
  665.  
  666. function TFloatEdit.GetFormat(var Fmt: TFloatFormat) : Boolean;
  667. begin
  668.   GetFormat := FloatGetFormat(HWindow, Fmt)
  669. end;
  670.  
  671. function TFloatEdit.GetRange(var Min, Max: Double) : Boolean;
  672. begin
  673.   GetRange := FloatGetRange(HWindow, Min, Max)
  674. end;
  675.  
  676. function TFloatEdit.GetValue(var LongValue: Double) : Boolean;
  677. begin
  678.   GetValue := FloatGetValue(HWindow, LongValue)
  679. end;
  680.  
  681. function TFloatEdit.SetFormat(var Fmt: TFloatFormat) : Boolean;
  682. begin
  683.   SetFormat := FloatSetFormat(HWindow, Fmt)
  684. end;
  685.  
  686. function TFloatEdit.SetMask(Mask: PChar) : Boolean;
  687. begin
  688.   SetMask := FloatSetMask(HWindow, Mask)
  689. end;
  690.  
  691. function TFloatEdit.SetRange(Min, Max: Longint) : Boolean;
  692. begin
  693.   SetRange := FloatSetRange(HWindow, Min, Max)
  694. end;
  695.  
  696. function TFloatEdit.SetStyle(Style: Longint) : Boolean;
  697. begin
  698. {
  699.   SetStyle := FloatSetStyle(HWindow, Style)
  700. }
  701. end;
  702.  
  703. function TFloatEdit.SetValue(LongValue: Longint) : Boolean;
  704. begin
  705.   SetValue := FloatSetValue(HWindow, LongValue)
  706. end;
  707.  
  708.  
  709. {---------------------------------------------------------------------------------------------------- }
  710. { INTEGER CONTROL IMPLEMENTATION                                       }
  711. {---------------------------------------------------------------------------------------------------- }
  712.  
  713. constructor TIntEdit.Init(aParent: PWindowsObject; AnID: Integer; ATitle: PChar; X,Y,W,H: Integer);
  714. begin
  715.   TStatic.Init(aParent, anID, aTitle, X,Y,W,H, 10);
  716.   Attr.Style := (Attr.Style and not ss_Left) or ws_Border or ws_TabStop;
  717. end;
  718.  
  719. function TIntEdit.GetClassName: PChar;
  720. begin
  721.   GetClassName := 'tbInteger';
  722. end;
  723.  
  724. function TIntEdit.GetValue(var LongValue: Longint) : Boolean;
  725. begin
  726.   GetValue := IntGetValue(HWindow, LongValue)
  727. end;
  728.  
  729. function TIntEdit.SetMask(Mask: PChar) : Boolean;
  730. begin
  731.   SetMask := IntSetMask(HWindow, Mask)
  732. end;
  733.  
  734. function TIntEdit.SetRange(Min, Max: Longint) : Boolean;
  735. begin
  736.   SetRange := IntSetRange(HWindow, Min, Max)
  737. end;
  738.  
  739. function TIntEdit.SetSpin(Spin, SpinWrap: Boolean; SpinInc: Longint) : Boolean;
  740. begin
  741.   SetSpin := IntSetSpin(HWindow, Spin, SpinWrap, SpinInc)
  742. end;
  743.  
  744. function TIntEdit.SetValue(LongValue: Longint) : Boolean;
  745. begin
  746.   SetValue := IntSetValue(HWindow, LongValue)
  747. end;
  748.  
  749.  
  750. {---------------------------------------------------------------------------------------------------- }
  751. { PIC CONTROL IMPLEMENTATION                                               }
  752. {---------------------------------------------------------------------------------------------------- }
  753.  
  754. constructor TPicEdit.Init(aParent: PWindowsObject; AnID: Integer; ATitle: PChar; X,Y,W,H: Integer);
  755. begin
  756.   TStatic.Init(aParent, anID, aTitle, X,Y,W,H, StrLen(ATitle));
  757.   Attr.Style := (Attr.Style and not ss_Left) or ws_Border or ws_TabStop;
  758. end;
  759.  
  760. function TPicEdit.GetClassName : PChar;
  761. begin
  762.   GetClassName := 'tbPic';
  763. end;
  764.  
  765. function TPicEdit.GetMask(Mask: PChar) : Boolean;
  766. begin
  767.   SendMessage(HWindow, EPM_GETMASK, 0, Longint(Mask));
  768.   GetMask := True;
  769. end;
  770.  
  771. function TPicEdit.SetCallBack : Boolean;
  772. begin
  773.   SetCallBack := False
  774. end;
  775.  
  776. function TPicEdit.SetMask(Mask: PChar) : Boolean;
  777. begin
  778.   SendMessage(HWindow, EPM_SETMASK, 0, Longint(Mask));
  779.   SetMask := True;
  780. end;
  781.  
  782.  
  783. {----------------------------------------------------------------------------------------------------------}
  784. { IMPRINT CONTROL IMPLEMENTATION                                                                           }
  785. {----------------------------------------------------------------------------------------------------------}
  786.  
  787. constructor TImprint.Init(aParent: PWindowsObject; AnID: Integer; ATitle: PChar; X,Y,W,H: Integer);
  788. begin
  789.   TStatic.Init(aParent, anID, aTitle, X,Y,W,H, StrLen(ATitle));
  790.   Attr.Style := (Attr.Style and not ss_Left) or ws_Border or ws_TabStop;
  791. end;
  792.  
  793. function TImprint.GetClassName : PChar;
  794. begin
  795.   GetClassName := 'tbImprint';
  796. end;
  797.  
  798. procedure TImprint.GetColor(var ImprintColor: TImprintColor);
  799. begin
  800.   SendMessage(HWindow, IM_GETCOLOR, 0, Longint(@ImprintColor));
  801. end;
  802.  
  803. function TImprint.GetFrameSize : Word;
  804. begin
  805.   GetFrameSize := SendMessage(HWindow, IM_GETFRAMESIZE, 0, 0);
  806. end;
  807.  
  808. function TImprint.GetLineCnt : Longint;
  809. begin
  810.   GetLineCnt := SendMessage(HWindow, IM_GETLINECNT, 0, 0);
  811. end;
  812.  
  813. function TImprint.GetLineSize : Word;
  814. begin
  815.   GetLineSize := SendMessage(HWindow, IM_GETLINESIZE, 0, 0);
  816. end;
  817.  
  818. function TImprint.GetShadowSize : Word;
  819. begin
  820.   GetShadowSize := SendMessage(HWindow, IM_GETSHADOWSIZE, 0, 0);
  821. end;
  822.  
  823. procedure TImprint.SetColor(var ImprintColor: TImprintColor);
  824. begin
  825.   SendMessage(HWindow, IM_SETCOLOR, 0, Longint(@ImprintColor));
  826. end;
  827.  
  828. procedure TImprint.SetFrameSize(Size: Word);
  829. begin
  830.   SendMessage(HWindow, IM_SETFRAMESIZE, Size, 0);
  831. end;
  832.  
  833. procedure TImprint.SetLineCnt(Horiz, Vert: Word);
  834. begin
  835.   SendMessage(HWindow, IM_SETLINECNT, MakeLong(Horiz, Vert), 0);
  836. end;
  837.  
  838. procedure TImprint.SetLineSize(Size: Word);
  839. begin
  840. end;
  841.  
  842. procedure TImprint.SetShadowSize(Size: Word);
  843. begin
  844. end;
  845.  
  846.  
  847. {----------------------------------------------------------------------------------------------------------}
  848. { SUPERBUTTON CONTROL CLASS                                                                                }
  849. {----------------------------------------------------------------------------------------------------------}
  850.  
  851. constructor TSuperButton.Init(aParent: PWindowsObject; AnID: Integer; ATitle: PChar; X,Y,W,H: Integer);
  852. begin
  853.   TButton.Init(aParent, anID, aTitle, X,Y,W,H, False);
  854. end;
  855.  
  856. function TSuperButton.GetClassName : PChar;
  857. begin
  858.   GetClassName := 'tbSuperBtn';
  859. end;
  860.  
  861. procedure TSuperButton.GetColor(var Color: TSuperBtnColor);
  862. begin
  863.   SendMessage(HWindow, SBM_GETCOLOR, 0, Longint(@Color));
  864. end;
  865.  
  866. procedure TSuperButton.SetColor(var Color: TSuperBtnColor);
  867. begin
  868.   SendMessage(HWindow, SBM_SETCOLOR, 0, Longint(@Color));
  869. end;
  870.  
  871. function TSuperButton.SetPict(PicType: Word; Resource: PChar) : Boolean;
  872. begin
  873.   SetPict := Boolean(SendMessage(HWindow, SBM_SETPICT, PicType, LongInt(Resource)));
  874. end;
  875.  
  876. function TSuperButton.SetPictBtnDown(PicType: Word; Resource: PChar) : Boolean;
  877. begin
  878.   SetPictBtnDown := Boolean(SendMessage(HWindow, SBM_SETPICT_BTNDOWN, PicType, Longint(Resource)));
  879. end;
  880.  
  881. function TSuperButton.SetPictDisabled(PicType: Word; Resource: PChar) : Boolean;
  882. begin
  883.   SetPictDisabled := Boolean(SendMessage(HWindow, SBM_SETPICT_DISABLED, PicType, Longint(Resource)));
  884. end;
  885.  
  886. procedure TSuperButton.SetStyle(Style: Word);
  887. begin
  888.   SendMessage(HWindow, SBM_SETSTYLE, Style, 0);
  889. end;
  890.  
  891.  
  892.  
  893.  
  894. {---------------------------------------------------------------------------------------------------- }
  895. { DATE CONTROL IMPLEMENTATION                                                  }
  896. {---------------------------------------------------------------------------------------------------- }
  897.  
  898. constructor TDateEdit.Init(aParent: PWindowsObject; AnID: Integer; ATitle: PChar; X,Y,W,H: Integer);
  899. begin
  900.   TEdit.Init(aParent, anID, aTitle, X,Y,W,H,10, false);
  901.   Attr.Style := (Attr.Style and not ss_left) or ws_Border or ws_TabStop
  902. end;
  903.  
  904. function TDateEdit.GetClassName: PChar;
  905. begin
  906.   GetClassName := 'tbDate'
  907. end;
  908.  
  909. function TDateEdit.GetFormat(var DateFmt: TDateFormat) : Boolean;
  910. begin
  911.   GetFormat := DateGetFormat(HWindow, DateFmt)
  912. end;
  913.  
  914. function TDateEdit.SetFormat(var DateFmt: TDateFormat) : Boolean;
  915. begin
  916.   SetFormat := DateSetFormat(HWindow, DateFmt)
  917. end;
  918.  
  919. function TDateEdit.SetRange(var MinDate, MaxDate: TDate) : Boolean;
  920. begin
  921.   SetRange := DateSetRange(HWindow, MinDate, MaxDate)  {Fehler!!!???}
  922. end;
  923.  
  924. begin
  925. end.
  926.  
  927.